#ifndef WEASEL_CONFIG_H
#define WEASEL_CONFIG_H
#include "lua.hpp"
#include <string>

struct st_mysql_config
{
    const char *host;
    int port;
    const char *username;
    const char *password;
    const char *sourcename;
    int max;
};

//配置单件类
class config
{
public:
    static config *get();

    bool init(const char *app);

    std::string app_name();

    const char *urls_path();

    const char *package_path();

    st_mysql_config &get_mysql_config();

private:
    config();
    ~config();

    void read_mysql_config();

private:
    lua_State *m_Lua;
    std::string m_app_name;
    std::string m_package_path;
    std::string m_urls_path;
    st_mysql_config m_mysql_config;
};

#endif